﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace PetroMentor.Service.Entities
{
    public class CommonQueryInfo<T>
    {
        public void Init(decimal resultcount, int pagenumber, int pagesize, List<T> resultinfos)
        {
            this.ResultCount = resultcount;
            this.PageNumber = pagenumber;
            this.PageSize = pagesize;
            this.PageCount = Math.Ceiling((double)resultcount / pagesize);
            this.ResultInfos = resultinfos;
        }

        public decimal ResultCount { get; set; }

        public int PageNumber { get; set; }

        public double PageCount { get; set; }

        public int PageSize { get; set; }

        public List<T> ResultInfos { get; set; }

    }
}